<template>
  <div class="app-container teacher-form-container">
    <div v-show="type === 0 || type === 2">
      <el-row>
        <el-col :span="24">
          <el-form
            :model="queryParams"
            ref="queryForm"
            size="small"
            :inline="true"
            v-show="showSearch"
            label-width="68px"
            v-if="enterpriseId === null"
          >
            <el-form-item label="商机名称" prop="businessName">
              <el-input
                v-model="queryParams.businessName"
                placeholder="请输入商机名称"
                clearable
                @keyup.enter.native="handleQuery"
              />
            </el-form-item>
            <el-form-item label="客户名称" prop="enterpriseName">
              <el-input
                v-model="queryParams.enterpriseName"
                placeholder="请输入客户名称"
                clearable
                @keyup.enter.native="handleQuery"
              />
            </el-form-item>
<!--            <el-form-item label="商机类型" prop="businessType">-->
<!--              <el-select-->
<!--                v-model="queryParams.businessType"-->
<!--                placeholder="请选择商机类型"-->
<!--              >-->
<!--                <el-option-->
<!--                  v-for="dict in dict.type.business_classify"-->
<!--                  :key="dict.value"-->
<!--                  :label="dict.label"-->
<!--                  :value="dict.value"-->
<!--                ></el-option>-->
<!--              </el-select>-->
<!--            </el-form-item>-->
            <el-form-item label="商机来源" prop="businessSource">
              <el-select
                v-model="queryParams.businessSource"
                placeholder="请选择商机来源"
              >
                <el-option
                  v-for="dict in dict.type.business_source"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="业务经理" prop="businessManagerNickName">
              <el-input
                v-model="queryParams.businessManagerNickName"
                placeholder="请输入业务经理"
                clearable
                @keyup.enter.native="handleQuery"
              />
            </el-form-item>
            <el-form-item label="商机阶段" prop="trackingStage">
              <el-select
                v-model="queryParams.businessState"
                placeholder="请选择商机阶段"
              >
                <el-option
                  v-for="dict in dict.type.business_state"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="开发经理" prop="developmentManager">
              <el-input
                v-model="queryParams.developmentManager"
                placeholder="请输入开发经理"
                clearable
                @keyup.enter.native="handleQuery"
              />
            </el-form-item>
            <el-form-item label="创建时间">
              <el-date-picker
                v-model="dateRange"
                style="width: 240px"
                value-format="yyyy-MM-dd"
                type="daterange"
                range-separator="-"
                start-placeholder="开始日期"
                end-placeholder="结束日期"
              ></el-date-picker>
            </el-form-item>
            <el-form-item>
              <el-button
                type="primary"
                icon="el-icon-search"
                size="mini"
                @click="handleQuery"
                >搜索</el-button
              >
              <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
                >重置</el-button
              >
            </el-form-item>
            <div class="">
              <el-form-item
                size="mini"
                label="商机类型"
                prop="teacherType"
              >
                <div class="manager-tags">
      <span
        v-for="manager in managerList"
        :key="manager.businessType"
        :class="['manager-tag', queryParams.businessType === manager.dictValue ? 'active' : '']"
        @click="handleManagerSelect(manager)"
      >
        {{ manager.dictLabel }}
      </span>
                </div>
              </el-form-item>
              </div>
          </el-form>
          <el-row :gutter="10" class="mb8" v-if="enterpriseId === null">
            <el-col :span="1.5">
              <el-button
                type="primary"
                plain
                icon="el-icon-plus"
                size="mini"
                @click="handleAdd"
                >新增</el-button
              >
            </el-col>
            <el-col :span="1.5" v-if="isShowOpt">
              <el-button
                type="info"
                plain
                icon="el-icon-upload2"
                size="mini"
                @click="handleImport"
                >导入</el-button
              >
            </el-col>
            <el-col :span="1.5" v-if="isShowOpt">
              <el-button
                type="warning"
                plain
                icon="el-icon-download"
                size="mini"
                @click="handleExport"
                v-has-hasPermi="['business:information:export']"
                >导出</el-button
              >
            </el-col>
            <el-col :span="1.5" v-if="isShowOpt">
              <el-button
                type="primary"
                plain
                icon="el-icon-edit"
                size="mini"
                :disabled="single"
                @click="userShow(1)"
                >修改业务经理</el-button
              >
            </el-col>
            <right-toolbar
              :showSearch.sync="showSearch"
              @queryTable="getList"
              :columns="columns"
            ></right-toolbar>
          </el-row>
          <div style="width: 100%;height: 90vh;overflow:auto; margin-bottom: 30%;padding-bottom: 18%;position: relative;">
          <el-table
            v-loading="loading"
            :height="500"
            :data="informationList"
            @selection-change="handleSelectionChange"
            :row-style="{ height: '30px' }"
            border
            :cell-style="{ padding: '0px' }"
            :row-class-name="tableRowClassName"
            highlight-current-row
          >
            <el-table-column type="selection" width="35" align="center" />
            <el-table-column
              label="序号"
              type="index"
              align="center"
              prop="index"
              :index="indexMethod"
            ></el-table-column>
            <el-table-column
              label="审核状态"
              align="center"
              prop="businessStatus"

              :show-overflow-tooltip="true"
              width="80"
            >
            <template slot-scope="scope">
              <div>{{scope.row.businessStatus==null?'未提交审核' : scope.row.businessStatus==0 ?'不通过' :scope.row.businessStatus==1 ? '通过':scope.row.businessStatus==2 ?'审核中':scope.row.businessStatus==3?'未提交审核':''}}</div>
            </template>
            </el-table-column>
            <el-table-column
              label="创建时间"
              align="center"
              prop="creationTime"
              width="85"
              v-if="columns[0].visible"
              :show-overflow-tooltip="true"
              sortable
            >
              <template slot-scope="scope">
                <span>{{
                    parseTime(scope.row.creationTime, "{y}-{m}-{d}")
                  }}</span>
              </template>
            </el-table-column>
            <el-table-column
              label="商机来源"
              align="center"
              prop="businessSource"
              v-if="columns[5].visible"
              :show-overflow-tooltip="true"
            >
              <template slot-scope="scope">
                <dict-tag
                  :options="dict.type.business_source"
                  :value="scope.row.businessSource"
                />
              </template>
            </el-table-column>
<!--            <el-table-column-->
<!--              label="开发经理"-->
<!--              align="center"-->
<!--              prop="developmentManager"-->
<!--              v-if="columns[14].visible"-->
<!--              :show-overflow-tooltip="true"-->
<!--              width="80"-->
<!--            />-->
            <el-table-column
              label="商机名称"
              align="center"
              prop="businessName"
              v-if="columns[1].visible"
              width="180"
              :show-overflow-tooltip="true"
            >
              <template slot-scope="scope">
                <span v-if="enterpriseId === null">
                   {{ scope.row.businessName }}
                </span>
                <span v-else-if="opt==='details'">
                   {{ scope.row.businessName }}
                </span>
                <a v-else @click.stop="handleUpdate(scope.row, scope.$index + 1)"
                   class="hyperlink"
                   style="color: #46a6ff">
                  {{ scope.row.businessName }}
                </a>
              </template>
            </el-table-column>
            <el-table-column
              label="客户名称"
              align="center"
              prop="enterpriseName"
              v-if="columns[2].visible"
              width="180"
              :show-overflow-tooltip="true"
            >
              <template slot-scope="scope">
                <a
                  @click="handleToEnterprise(scope.row)"
                  class="hyperlink"
                  style="color: #46a6ff"
                >
                  {{ scope.row.enterpriseName }}
                </a>
              </template>
            </el-table-column>
            <el-table-column
              label="商机类型"
              align="center"
              prop="businessType"
              v-if="columns[4].visible"
              width="90"
              :show-overflow-tooltip="true"
            >
              <template slot-scope="scope">
                <dict-tag
                  :options="dict.type.business_classify"
                  :value="scope.row.businessType"
                />
              </template>
            </el-table-column>
            <el-table-column
              label="联系人"
              align="center"
              prop="contacts"
              width="100"
              v-if="columns[6].visible"
              :show-overflow-tooltip="true"
            />
            <el-table-column
              label="联系电话"
              align="center"
              prop="telephone"
              width="110"
              v-if="columns[7].visible"
              :show-overflow-tooltip="true"
            />
            <el-table-column
              label="商机阶段"
              align="center"
              prop="businessState"
              v-if="columns[3].visible"
              width="90"
              :show-overflow-tooltip="true"
            >
              <template slot-scope="scope">
                <dict-tag
                  :options="dict.type.business_state"
                  :value="scope.row.businessState"
                />
              </template>
            </el-table-column>
            <el-table-column
             label="业务经理"
             align="center"
             prop="businessManagerNickName"
             v-if="columns[9].visible"
             :show-overflow-tooltip="true"
             />
            <!-- <el-table-column
              label="最新操作时间"
              align="center"
              prop="followTime"
              v-if="columns[18].visible"
              width="100"
              :show-overflow-tooltip="true"
            /> -->
            <!-- <el-table-column
              label="联系人职位"
              align="center"
              prop="position"
              width="100"
              v-if="columns[8].visible"
              :show-overflow-tooltip="true"
            /> -->
           <el-table-column
              label="商机提供人"
             align="center"
             prop="businessProvider"
             width="100"
             v-if="columns[9].visible"
           :show-overflow-tooltip="true"
           />
            <!-- <el-table-column
              label="预计成交时间"
              align="center"
              prop="expectedDate"
              width="120"
              v-if="columns[10].visible"
              :show-overflow-tooltip="true"
            >
              <template slot-scope="scope">
                <span>{{
                  parseTime(scope.row.expectedDate, "{y}-{m}-{d}")
                }}</span>
              </template>
            </el-table-column> -->
            <!-- <el-table-column
              label="创建人"
              align="center"
              prop="creationNickName"
              v-if="columns[11].visible"
              width="100"
              :show-overflow-tooltip="true"
            /> -->
            <!-- <el-table-column
              label="跟单阶段"
              align="center"
              prop="trackingStage"
              v-if="columns[12].visible"
              :show-overflow-tooltip="true"
            >
              <template slot-scope="scope">
                <dict-tag
                  :options="dict.type.tracking_stage"
                  :value="scope.row.trackingStage"
                />
              </template>
            </el-table-column> -->

            <!-- <el-table-column
              label="业务经理"
              align="center"
              prop="businessManagerNickName"
              v-if="columns[15].visible"
              :show-overflow-tooltip="true"
              width="100"
            /> -->
            <!-- <el-table-column
              label="协作人"
              align="center"
              prop="collaboratorNickName"
              v-if="columns[16].visible"
              :show-overflow-tooltip="true"
              width="100"
            /> -->
            <!-- <el-table-column
              label="附件"
              align="center"
              v-if="columns[17].visible"
            >
              <template slot-scope="scope">
                <el-button
                  @click.stop="queryUploadFile(scope.row.businessId)"
                  size="small"
                  v-if="scope.row.url != null && scope.row.url !== ''"
                  type="text"
                  >附件</el-button
                >
                <el-button size="small" v-else type="text">无附件</el-button>
              </template>
            </el-table-column> -->
            <el-table-column
              v-if="enterpriseId === null"
              label="操作"
              align="center"
              class-name="small-padding fixed-width"
              fixed="right"
              width="100"
              style="background-color: red"
            >
              <template slot-scope="scope">
                <!-- v-if="scope.row.operateId==adminuser" -->
                <el-button
                  size="mini"
                  type="text"
                  icon="el-icon-edit"
                  @click.stop="handleUpdate(scope.row, scope.$index + 1)"
                  title="修改"
                ></el-button>
<!--                <el-button-->
<!--                  v-if="scope.row.businessStatus==1"-->
<!--                  size="mini"-->
<!--                  type="text"-->
<!--                  icon="el-icon-tickets"-->
<!--                  @click.stop="addQuotation(scope.row)"-->
<!--                ></el-button>-->
                <!-- v-if="isShowOpt" -->
<!--                <el-button-->
<!--                v-if="scope.row.businessStatusUser==adminuser&&scope.row.businessStatus==null||scope.row.businessStatus==2"-->
<!--                  size="mini"-->
<!--                  type="text"-->
<!--                  icon="el-icon-refresh-right"-->
<!--                  @click.stop="handleContract(scope.row)"-->
<!--                ></el-button>-->
                <el-button
                  size="mini"
                  type="text"
                  icon="el-icon-delete"
                  @click.stop="handleDelete(scope.row)"
                  title="删除"
                ></el-button>
              </template>
            </el-table-column>
          </el-table>

          <pagination
            v-show="total > 0"
            :total="total"
            :page.sync="queryParams.pageNum"
            :limit.sync="queryParams.pageSize"
            @pagination="getList"
          />
          </div>
        </el-col>
      </el-row>
    </div>
    <div v-if="type === 1">
      <Operate
        @change="close"
        :index="index"
        :opt="edit"
        :uuid="uuid"
        :isClick="isClick"
        :id="id"
        :classId="classId"
        :enterpriseId="eId"
        :enterpriseName="eName"
        :rowList="rowList"
        :newBId="newBId"
        :businessName="businessName"
      >
      </Operate>
    </div>
    <el-dialog :visible.sync="dialogVisible" append-to-body>
      <img width="100%" :src="dialogImageUrl" alt="" />
    </el-dialog>
    <!-- 审核弹框 -->
    <el-dialog
      :visible.sync="dialogVisibleshop"
      title="审核商机"
    >
    <el-form ref="shopform" :model="shopform" :rules="rules" class="forms">
      <el-form-item label="审核选择" prop="businessStatus">
        <el-radio-group v-model="shopform.businessStatus"  @change="remarkText">
          <el-radio :label="1" >审核通过</el-radio>
          <el-radio :label="0">审核不通过</el-radio>
          <!--        //纠错，荣誉，证书不需要驳回-->
          <!-- <el-radio :label="4" v-show="type==101  || type==103 || type==104 ||type==105 ">驳回</el-radio> -->
        </el-radio-group>
      </el-form-item>
      <!-- <el-form-item label="审核意见" prop="remark">
        <el-input v-model="form.remark" type="textarea" :rows="6"  style="width:80%" placeholder="请输入审核意见"/>
      </el-form-item> -->
    </el-form>
    <div class="dialog-footer">
      <el-button type="primary" @click="submitForm('shopform')">确 定</el-button>
      <el-button @click="cancel">取 消</el-button>
    </div>
    </el-dialog>
    <el-dialog
      :visible.sync="openQuotationList"
      append-to-body
      width="1200px"
      title="报价单信息"
    >
      <el-row :gutter="10" class="mb8" v-if="enterpriseId === null">
        <el-col :span="1.5">
          <el-button
            type="primary"
            plain
            icon="el-icon-plus"
            size="mini"
            @click="handleAddQuotation"
            >新增</el-button
          >
        </el-col>
      </el-row>
      <el-table
        v-loading="loading"
        style="width: 100%"
        :data="quotationInfoList"
      >
        <el-table-column
          label="立项编号"
          align="center"
          prop="approvalNumber"
        />
        <el-table-column
          label="公司名称"
          align="center"
          prop="companyName"
          :show-overflow-tooltip="true"
        />
        <el-table-column
          label="地址"
          align="center"
          prop="address"
          :show-overflow-tooltip="true"
          width="200"
        />
        <el-table-column
          label="认证机构"
          align="center"
          prop="certificateAuthority"
          :show-overflow-tooltip="true"
        />
        <el-table-column
          label="联系人"
          align="center"
          prop="contacts"
          :show-overflow-tooltip="true"
          width="80"
        />
        <el-table-column
          label="联系电话"
          align="center"
          prop="unit"
          :show-overflow-tooltip="true"
          width="120"
        />
        <el-table-column
          label="客户需求"
          align="center"
          prop="customerDemand"
          :show-overflow-tooltip="true"
          width="220"
        />
        <el-table-column
          label="操作"
          align="center"
          :show-overflow-tooltip="true"
          width="80"
        >
          <template slot-scope="scope">
            <el-button
              v-if="scope.row.isSubmit === '0'"
              icon="el-icon-edit"
              size="mini"
              type="text"
              @click="handleEditQuotation(scope.row)"
              title="编辑"
            ></el-button>
            <el-button
              icon="el-icon-view"
              size="mini"
              type="text"
              v-if="scope.row.isSubmit === '1'"
              @click="handleViewQuotation(scope.row)"
              title="查看"
            ></el-button>
            <el-button
              size="mini"
              type="text"
              icon="el-icon-delete"
              v-if="scope.row.isSubmit === '0'"
              @click="handleDeleteQuotation(scope.row)"
              title="删除"
            ></el-button>
          </template>
        </el-table-column>
      </el-table>
      <pagination
        v-show="total3 > 0"
        :total="total3"
        :page.sync="queryParamsQuotation.pageNum"
        :limit.sync="queryParamsQuotation.pageSize"
        @pagination="getQuotation"
      />
    </el-dialog>
    <el-dialog :visible.sync="dialogVisiblePdf" append-to-body>
      <pdf
        v-for="item in pageTotal"
        :src="pdfUrl"
        :key="item"
        :page="item"
      ></pdf>
    </el-dialog>
    <el-dialog
      :title="titleClass"
      :visible.sync="openMainClass"
      width="500px"
      append-to-body
    >
      <el-form ref="formClass" :model="formClass" :inline="true"> </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitClassForm()">确 定</el-button>
        <el-button @click="cancelClass">关 闭</el-button>
      </div>
    </el-dialog>
    <select-user
      ref="select"
      :type="userType"
      :sign="sign"
      @ok="selectUser"
    ></select-user>
    <SelectRoleUser
      ref="selectRole"
      :type="userType"
      :sign="newSign"
      :menuId="menuId"
      @ok="selectRoleUser"
    >
    </SelectRoleUser>

    <el-dialog
      :title="titleQuotation"
      :visible.sync="openQuotation"
      width="800px"
      append-to-body
    >
      <el-form
        ref="form"
        :model="form"
        :rules="rulesQuotation"
        label-width="120px"
      >
        <el-row>
          <el-col :span="8" style="height: 55px">
            <el-form-item
              label="立项编号"
              prop="approvalNumber"
              label-width="80px"
            >
              <el-input
                v-model="form.approvalNumber"
                placeholder="请输入立项编号"
                :disabled="disabled"
                style="width: 260px"
              />
            </el-form-item>
          </el-col>
          <el-col :span="14" style="height: 55px">
            <el-form-item
              label="公司名称"
              prop="companyName"
              label-width="230px"
            >
              <el-input
                v-model="form.companyName"
                placeholder="请输入公司名称"
                disabled
              />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8" style="height: 55px">
            <el-form-item
              label="认证机构"
              prop="certificateAuthority"
              label-width="80px"
            >
              <el-input
                v-model="form.certificateAuthority"
                placeholder="请输入认证机构"
                :disabled="disabled"
                style="width: 260px"
              />
            </el-form-item>
          </el-col>
          <el-col :span="14" style="height: 55px">
            <el-form-item
              label="员工人数"
              prop="employeeNumber"
              label-width="230px"
            >
              <el-input
                v-model="form.employeeNumber"
                placeholder="请输入员工人数"
                :disabled="disabled"
              />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="22" style="height: 55px">
            <el-form-item label="地址" prop="address" label-width="80px">
              <el-input v-model="form.address" disabled />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8" style="height: 55px">
            <el-form-item label="联系人" prop="contacts" label-width="80px">
              <el-select
                v-model="form.contacts"
                placeholder="请选择联系人"
                style="width: 260px"
                :disabled="disabled"
                @change="handleContactChange"
              >
                <el-option
                  v-for="person in contactsList"
                  :key="person.id"
                  :label="person.name"
                  :value="person.name"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="14" style="height: 55px">
            <el-form-item label="联系电话" prop="unit" label-width="230px">
              <el-select
                v-model="form.unit"
                placeholder="请选择联系电话"
                :disabled="disabled"
              >
                <el-option
                  v-for="person in contactsList"
                  :key="person.id"
                  :label="person.phone"
                  :value="person.phone"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="22" style="height: 55px">
            <el-form-item
              label="客户需求"
              prop="customerDemand"
              label-width="80px"
            >
              <el-input
                v-model="form.customerDemand"
                placeholder="请输入客户需求"
                :disabled="disabled"
              />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row style="margin: 10px 0px 12px 12px">
          <el-row :gutter="10" class="mb8" v-if="isDel">
            <el-col :span="1.5">
              <el-button
                type="primary"
                plain
                icon="el-icon-plus"
                size="mini"
                @click="addProductInfo"
                >新增</el-button
              >
            </el-col>
          </el-row>
          <el-table :data="tableData" style="width: 91%" ref="tableData">
            <el-table-column
              label="序号"
              type="index"
              align="center"
              prop="indexTwo"
            />
            <el-table-column
              prop="systemType"
              label="产品"
              min-width="120"
              align="center"
            >
              <template slot-scope="scope">
                <el-input
                  v-model="scope.row.systemType"
                  type="textarea"
                  :autosize="{ minRows: 1, maxRows: 4 }"
                  :disabled="disabled"
                  readonly="readonly"
                  @focus="selectProduct(scope.row.indexTwo)"
                />
              </template>
            </el-table-column>
            <el-table-column
              prop="fees"
              label="费用"
              min-width="60"
              align="center"
            >
              <template slot-scope="scope">
                <el-input
                  v-model="scope.row.fees"
                  :disabled="disabled"
                  :maxlength="18"
                />
              </template>
            </el-table-column>
            <el-table-column
              prop="notes"
              label="备注"
              min-width="160"
              align="center"
            >
              <template slot-scope="scope">
                <el-input
                  v-model="scope.row.notes"
                  type="textarea"
                  :maxlength="800"
                  :autosize="{ minRows: 1, maxRows: 4 }"
                  :disabled="disabled"
                />
              </template>
            </el-table-column>
            <el-table-column
              fixed="right"
              label="操作"
              min-width="40"
              align="center"
              v-if="isDel"
            >
              <template slot-scope="scope">
                <el-button
                  type="text"
                  size="small"
                  @click="delProductInfo(scope.row)"
                  >删除</el-button
                >
              </template>
            </el-table-column>
          </el-table>
        </el-row>
        <el-row>
          <el-col :span="22" style="height: 92px">
            <el-form-item
              label="报价说明"
              prop="quotationDescription"
              label-width="80px"
            >
              <el-input
                v-model="form.quotationDescription"
                type="textarea"
                :rows="3"
                placeholder=" 请输入报价说明内容"
                :disabled="disabled"
              />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="22" style="height: 92px">
            <el-form-item
              label="付款方式"
              prop="paymentMethod"
              label-width="80px"
            >
              <el-input
                v-model="form.paymentMethod"
                type="textarea"
                :rows="3"
                placeholder=" 请输入付款方式内容"
                :disabled="disabled"
              />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="22" style="height: 92px">
            <el-form-item
              label="售后服务"
              prop="afterService"
              label-width="80px"
            >
              <el-input
                v-model="form.afterService"
                type="textarea"
                :rows="3"
                placeholder=" 请输入售后服务内容"
                :disabled="disabled"
              />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="22" style="height: 92px">
            <el-form-item label="温馨提示" prop="tips" label-width="80px">
              <el-input
                v-model="form.tips"
                type="textarea"
                :rows="3"
                placeholder=" 请输入温馨提示内容"
                :disabled="disabled"
              />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8" style="height: 52px">
            <el-form-item label="审批人" prop="approvalName" label-width="80px">
              <el-input
                :value="form.approvalDisplayName || form.approvalName"
                placeholder="请输入审批人"
                @focus="userRoleShow()"
                :disabled="disabled"
                readonly
              />
            </el-form-item>
          </el-col>
          <el-col :span="14" v-if="isShow" style="height: 52px">
            <el-form-item
              label="审批结果"
              prop="approvalResults"
              label-width="230px"
            >
              <el-radio-group
                v-model="form.approvalResults"
                style="margin-left: 40px"
                :disabled="result"
              >
                <el-radio label="同意"></el-radio>
                <el-radio label="不同意"></el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row v-if="isShow">
          <el-col :span="22">
            <el-form-item
              label="审批信息"
              prop="approvalInformation"
              label-width="80px"
            >
              <el-input
                v-model="form.approvalInformation"
                type="textarea"
                :autosize="{ minRows: 2, maxRows: 4 }"
                placeholder=" 请输入审批信息"
                :disabled="result"
              />
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div style="text-align: center">
        <el-button type="primary" @click="submitFormQuotation" v-if="isSave"
          >提 交</el-button
        >
        <el-button type="primary" @click="twoSave" v-if="isTwoSave"
          >复 制</el-button
        >
        <el-button type="primary" @click="saveFormQuotation" v-if="isSave"
          >保 存</el-button
        >
        <el-button type="primary" @click="printPreview" v-if="isPrint"
          >打印预览</el-button
        >
        <el-button @click="cancelQuotation">关 闭</el-button>
      </div>
    </el-dialog>
    <div v-if="type === 3">
      <ContractOperate
        @change="close"
        :opt="edit"
        :uuid="uuid"
        :isClick="isClick"
        :id="id"
        :convenant="contractName"
        :customerId="customerId"
      >
      </ContractOperate>
    </div>
    <el-dialog :visible.sync="openPrint" width="800px" append-to-body>
      <div class="baojia-fram" id="print" ref="print">
        <div class="baojia-header">
          <h2>
            <lable
              ><img src="@/assets/images/img01.jpg" />
              湖南省环通企业管理咨询有限公司</lable
            >
            <span>正直、责任、感恩、专业、精进</span>
          </h2>
        </div>
        <div class="baojia-infor">
          <h3 class="baojia-infor-title">
            <b>报价函</b>（<span style="font-weight: bold">立项编号</span
            >：<label>{{ newApprovalNumber }}</label
            >）
          </h3>
          <div class="baojia-infor-p">
            <p>尊敬的客户：</p>
            <p class="eetwo">
              您好！首先非常感谢您以及贵司对环通咨询服务的信任与支持！作为环通咨询的优质客户，我司将竭尽全力提供最为优质的综合服务。
            </p>
            <p class="eetwo">
              与贵公司初步沟通，了解到企业基础信息及需求，并做出如下报价：
            </p>
            <p>
              {{ newCompanyName
              }}<span style="float: right"
                >员工人数：{{ newEmployeeNumber }}人</span
              >
            </p>
            <p>
              地&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;址：{{ newAddress }}
            </p>
            <p>认证机构：{{ newCertificateAuthority }}</p>
            <p>联&nbsp;&nbsp;系&nbsp;&nbsp;人：{{ newContacts + newPhone }}</p>
            <p>客户需求：{{ newCustomerDemand }}</p>
            <!-- <p style="text-align: right">单位：{{ newUnit }}元/年</p> -->
            <table class="baojia-table">
              <thead>
                <tr>
                  <th width="10%" style="font-weight: normal">序号</th>
                  <th width="25%" style="font-weight: normal">产品名称</th>
                  <th width="20%" style="font-weight: normal">费用</th>
                  <th width="45%" style="font-weight: normal">备注</th>
                </tr>
              </thead>
              <tbody>
                <tr v-for="(data, index) in tableData">
                  <td>{{ index + 1 }}</td>
                  <td>
                    <P>{{ data.systemType }}</P>
                  </td>
                  <td>{{ data.fees }}</td>
                  <td>
                    <p>{{ data.notes }}</p>
                  </td>
                </tr>
              </tbody>
            </table>
            <p>注：1、报价说明：</p>
            <p class="eetwo">{{ newQuotationDescription }}</p>
            <p class="eetwo">2、付款方式：</p>
            <p class="eetwo">
              {{ newPaymentMethod }}
            </p>
            <p class="eetwo">3、售后服务：</p>
            <p class="eetwo">{{ newAfterService }}</p>
            <p class="eetwo">4、温馨提示：</p>
            <p class="eetwo">{{ newTips }}</p>
          </div>
          <div class="line"></div>
          <div class="baojia-div">
            <ul class="baojia-div-left">
              <li>项目负责人：<span></span></li>
              <li>市&nbsp;场&nbsp;总&nbsp;监：<span></span></li>
              <li>公司总经理：<span></span></li>
              <li>
                日&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;期：<span
                ></span>
              </li>
            </ul>
            <ul class="baojia-div-right">
              <li>公司公章：</li>
              <li>公司名称：{{ newEnterpriseName }}</li>
              <li>公司地址：{{ newEnterpriseAddress }}</li>
              <li>公司电话：{{ newTelephone }}</li>
            </ul>
          </div>
        </div>
        <div class="no-print" style="text-align: center">
          <el-button type="primary" @click="printInformation">打印</el-button>
          <el-button @click="closePrint">关 闭</el-button>
        </div>
      </div>
    </el-dialog>
    <el-dialog
      title="商机导入"
      :visible.sync="upload.open"
      width="400px"
      append-to-body
    >
      <el-upload
        ref="upload"
        :limit="1"
        accept=".xlsx, .xls"
        :headers="upload.headers"
        :action="upload.url + '?updateSupport=' + upload.updateSupport"
        :disabled="upload.isUploading"
        :auto-upload="false"
        drag
        :on-progress="handleFileUploadProgress"
        :on-success="handleFileSuccess"
      >
        <i class="el-icon-upload"></i>
        <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
        <div class="el-upload__tip text-center" slot="tip">
          <span>仅允许导入xls、xlsx格式文件。</span>
          <el-link
            type="primary"
            :underline="false"
            style="font-size: 12px; vertical-align: baseline"
            @click="importTemplate"
            >下载模板</el-link
          >
        </div>
      </el-upload>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitFileForm">确 定</el-button>
        <el-button @click="upload.open = false">关 闭</el-button>
      </div>
    </el-dialog>
    <el-dialog
      title="选择产品"
      :visible.sync="openProduct"
      width="1000px"
      append-to-body
    >
      <el-row>
        <el-col>
          <el-form
            :model="queryContractProductParams"
            ref="queryContractForm"
            size="small"
            :inline="true"
            v-show="showSearch"
            label-width="68px"
          >
            <el-form-item label="产品类别" prop="productType">
              <el-select
                v-model="queryContractProductParams.productType"
                placeholder="请选择产品类别"
                clearable
              >
                <el-option
                  v-for="dict in dict.type.product_type"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                />
              </el-select>
            </el-form-item>
            <el-form-item label="产品编号" prop="productNo">
              <el-input
                v-model="queryContractProductParams.productNo"
                placeholder="请输入产品编号"
                clearable
                @keyup.enter.native="handleQuery"
              />
            </el-form-item>
            <el-form-item label="产品名称" prop="productName">
              <el-input
                v-model="queryContractProductParams.productName"
                placeholder="请输入产品名称"
                clearable
                @keyup.enter.native="handleQuery"
              />
            </el-form-item>
            <el-form-item>
              <el-button
                type="primary"
                icon="el-icon-search"
                size="mini"
                @click="handleQueryProduct"
                >搜索</el-button
              >
              <el-button
                icon="el-icon-refresh"
                size="mini"
                @click="resetQueryProduct"
                >重置</el-button
              >
              <el-button type="primary" size="mini" @click="saveContractProduct"
                >确定</el-button
              >
            </el-form-item>
          </el-form>
          <el-table
            v-loading="loading"
            :data="qualificationList"
            ref="tableProduct"
            @current-change="handleSelectionChangeContractProduct"
            row-key="id"
            highlight-current-row
          >
            <el-table-column
              label="序号"
              type="index"
              :index="indexProductMethod"
            />
            <el-table-column label="产品类别" align="center" prop="productType">
              <template slot-scope="scope">
                <dict-tag
                  :options="dict.type.product_type"
                  :value="scope.row.productType"
                />
              </template>
            </el-table-column>
            <el-table-column label="产品编号" align="center" prop="productNo" />
            <el-table-column
              label="产品名称"
              align="center"
              prop="productName"
            />
            <el-table-column label="费用" align="center" prop="productPrice" />
          </el-table>
          <pagination
            v-show="total2 > 0"
            :total="total2"
            :page.sync="queryContractProductParams.pageNum"
            :limit.sync="queryContractProductParams.pageSize"
            @pagination="getProductList"
          />
        </el-col>
      </el-row>
    </el-dialog>
    <el-dialog
      title="查看附件"
      :visible.sync="openFileList"
      width="500px"
      append-to-body
    >
      <el-table :data="fileList">
        <el-table-column label="文件名称" align="center" prop="fileName" />
        <el-table-column
          label="操作"
          align="center"
          class-name="small-padding fixed-width"
          fixed="right"
          width="120"
        >
          <template slot-scope="scope">
            <el-button
              size="mini"
              type="text"
              icon="el-icon-view"
              @click.stop="handleView(scope.row)"
              title="查看"
            ></el-button>
            <el-button
              size="mini"
              type="text"
              icon="el-icon-download"
              title="下载"
              @click="handleDownload(scope.row.url, scope.row.fileName)"
            ></el-button>
          </template>
        </el-table-column>
      </el-table>
    </el-dialog>
    <el-row style="margin-top: 10px">
      <div
        v-if="openRecords"
        style="
          width: 100%;
          margin: 0 auto;
          box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
        "
      >
        <el-row>
          <div style="margin: 3px 0px 0px 15px">
            <el-descriptions title="">
              <el-descriptions-item label="序号">
                <el-tag size="medium">{{ this.newIndex }}</el-tag>
              </el-descriptions-item>
            </el-descriptions>
          </div>
          <el-col :span="24">
            <BusinessRecords
              @change="loadList"
              :bId="bId"
              :obj="obj"
              :optBtn="optBtn"
            ></BusinessRecords>
          </el-col>
        </el-row>
      </div>
    </el-row>
  </div>
</template>
<script>
import {
  listInformation,
  delInformation,
  editMainClass,
  editBusinessManager,
  updateInformation
} from "@/api/enterprise/information";
import {getDicts} from "@/api/system/dict/data";
import {
  listInfo,
  getQuotationInfo,
  delInfo,
  saveQuotationProductMessage,
  updateQuotationProductMessage,
  sysDeptInfo,
} from "@/api/enterprise/quotation";
import { listMessage,listManager } from "@/api/enterprise/message";
import { getSupplierInfo } from "@/api/supplier/supplier";
import { listQualificationAll } from "@/api/qualificationInfo/qualification";
import { getInfo } from "@/api/enterprise/info";
import { getElectric } from "@/api/electric/electric";
import { getSeas } from "@/api/highSeas/seas";
import { download } from "@/utils/request";
import { queryFile } from "@/api/system/file";
import MainType from "@/components/MainType/index";
// import Operate from "./operate"
import { getToken } from "../../../utils/auth";
import { listType } from "@/api/maintype/type";
import SelectUser from "../../system/role/selectUser.vue";
import SelectRoleUser from "../../system/role/selectUser.vue";
import EnterpriseInfo from "../../enterprise/info/index.vue";
import BusinessRecords from "../../records/records.vue";
import ContractOperate from "../../contract/operate.vue";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { listPerson } from "@/api/enterprise/person";
import pdf from "vue-pdf";
export default {
  name: "BusinessInfo",
  components: {
    MainType,
    SelectUser,
    EnterpriseInfo,
    BusinessRecords,
    pdf,
    ContractOperate,
    SelectRoleUser,
    Operate: () => import("./operate"),
  },
  dicts: [
    "business_classify",
    "customer_industry",
    "business_state",
    "tracking_stage",
    "enterprise_records",
    "product_type",
    "product_status",
    "customer_industry",
    "administrative_area",
    "qualification_resume_status",
    "business_source",
  ],
  props: {
    enterpriseId: {
      type: String,
      default: null,
    },
    enterpriseName: {
      type: String,
      default: "",
    },
    isEnterprise: {
      type: Boolean,
      default: true,
    },
    isShowOpt: {
      type: Boolean,
      default: true,
    },
    opt:{
      type: String,
      default: null,
    },
  },
  data() {
    var approvalName = (rule, value, callback) => {
      if (!value) {
        return callback(new Error("审批人不能为空"));
      }
      return callback();
    };
    return {
      shopform:{
        businessStatus:null,
        businessId:''
      },
      selectedManager: null, // 初始没有选中任何manager
      certificateTypeOptions:[],
      contactsList: [], // 联系人列表
      defaultContact: null, // 默认联系人
      defaultPhone: null, // 默认电话
      contractName: null,
      managerList:[],
      rowList: null,
      openQuotationList: false,
      optBtn: true,
      uploadList: [],
      fileList: [],
      isTree: false,
      openFileList: false,
      qualificationCode: "qualification",
      openProduct: false,
      isTwoSave: false,
      customerId: null,
      typeContract: 0,
      dateRange: [],
      readonly: true,
      disabled: false,
      isSave: true,
      result: false,
      openPrint: false,
      openRecords: false,
      isDel: true,
      openMainClass: false,
      openEnterprise: false,
      titleClass: "修改主分类",
      optionData: null,
      isShow: false,
      userType: "1",
      sign: "1",
      newSign: "2",
      menuId: "2121",
      isPrint: false,
      isClick: true,
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      tableData: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      total2: 0,
      // 【请填写功能名称】表格数据
      informationList: [],
      infoList: [],
      // 弹出层标题
      title: "",
      pageTotal: null,
      // 是否显示弹出层
      open: false,
      //主分类
      typeCode: "business",
      dialogVisible: false,
      dialogVisiblePdf: false,
      dialogVisibleshop: false,
      openQuotation: false,
      titleQuotation: "",
      dialogImageUrl: "",
      dialogImageUrlPdf: "",
      type: 0,
      number: 0,
      classId: "",
      eId: "",
      eName: "",
      // *********
      newApprovalNumber: null,
      newCompanyName: null,
      newEmployeeNumber: null,
      newAddress: null,
      newCertificateAuthority: null,
      newContacts: null,
      newPhone: null,
      newCustomerDemand: null,
      newUnit: null,
      newQuotationDescription: null,
      newPaymentMethod: null,
      newAfterService: null,
      newTips: null,
      newEnterpriseName: null,
      newEnterpriseAddress: null,
      newTelephone: null,
      pdfUrl: "",
      showIndex: 0,
      businessName:null,
      // *********
      // 公海导入参数
      upload: {
        // 是否显示弹出层（用户导入）
        open: false,
        // 弹出层标题（用户导入）
        title: "",
        // 是否禁用上传
        isUploading: false,
        // 是否更新已经存在的用户数据
        updateSupport: 0,
        // 设置上传的请求头部
        headers: { Authorization: "Bearer " + getToken() },
        // 上传的地址
        url: process.env.VUE_APP_BASE_API + "/business/information/importData",
      },
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 15,
        businessName: null,
        classificationId: null,
        enterpriseId: null,
        enterpriseName: null,
        businessState: null,
        businessType: null,
        businessSource: null,
        contacts: null,
        telephone: null,
        position: null,
        businessProvider: null,
        expectedDate: null,
        trackingStage: null,
        followPerson: null,
        developmentId: null,
        transactionId: null,
        developmentManager: null,
        businessManager: null,
        businessManagerNickName:null,
        collaboratorId: null,
        collaboratorName: null,
        creationTime: null,
        operateTime: null,
        operateId: null,
        departmentId: null,
        departmentName: null,
        organizationId: null,
        organizationName: null,
        creationId: null,
        creationName: null,
      },
      queryContractProductParams: {
        pageNum: 1,
        pageSize: 5,
        approve: null,
        productType: null,
        productNo: null,
        productName: null,
        productStatus: null,
        classificationId: null,
      },
      queryParamsMessage: {
        pageNum: 1,
        pageSize: 15,
        quotationId: null,
        systemType: null,
        fees: null,
        notes: null,
      },
      queryParamsQuotation: {
        pageNum: 1,
        pageSize: 15,
        businessId: null,
        approvalNumber: null,
      },
      // 列信息
      columns: [
        { key: 0, label: `创建时间`, visible: true },
        { key: 1, label: `商机名称`, visible: true },
        { key: 2, label: `客户名称`, visible: true },
        { key: 3, label: `商机状态`, visible: true },
        { key: 4, label: `商机类型`, visible: true },
        { key: 5, label: `商机来源`, visible: true },
        { key: 6, label: `联系人姓名`, visible: true },
        { key: 7, label: `联系人电话`, visible: true },
        { key: 8, label: `联系人职位`, visible: true },
        { key: 9, label: `商机提供人`, visible: true },
        { key: 10, label: `预计成交时间`, visible: true },
        { key: 11, label: `创建人`, visible: true },
        { key: 12, label: `跟单阶段`, visible: true },
        { key: 13, label: `跟单人`, visible: true },
        { key: 14, label: `开发经理`, visible: true },
        { key: 15, label: `业务经理`, visible: true },
        { key: 16, label: `协作人`, visible: true },
        { key: 17, label: `附件`, visible: true },
        { key: 18, label: `最新操作时间`, visible: true },
        // { key: 19, label: `创建机构`, visible: true }
      ],
      // 表单参数
      form: {
        quotationId: null,
        businessId: null,
        approvalNumber: null,
        companyId: null,
        companyName: null,
        employeeNumber: null,
        address: null,
        certificateAuthority: null,
        contacts: null,
        customerDemand: null,
        unit: null,
        quotationDescription: null,
        paymentMethod: null,
        afterService: null,
        tips: null,
        isSubmit: null,
        approvalId: null,
        approvalName: null,
        approvalResults: null,
        approvalInformation: null,
        creationTime: null,
        operateTime: null,
        operateId: null,
      },
      formQuotation: {},
      formClass: {},
      formData: {},
      // 表单校验
      rules: {
        businessStatus: [
            { required: true, message: '请选择', trigger: 'change' }
          ],
      },
      rulesQuotation: {
        approvalNumber: [
          { required: true, message: "立项编号不能为空", trigger: "blur" },
          { max: 36, message: "立项编号长度不能超过36个字符", trigger: "blur" },
        ],
        certificateAuthority: [
          { required: true, message: "认证机构不能为空", trigger: "change" },
          { max: 25, message: "认证机构长度不能超过25个字", trigger: "blur" },
        ],
        contacts: [
          { required: true, message: "请选择联系人", trigger: "change" },
        ],
        unit: [
          { required: true, message: "请选择联系电话", trigger: "change" },
        ],
        employeeNumber: [
          { required: true, message: "员工人数不能为空", trigger: "change" },
          { max: 10, message: "联系人长度不能超过10个字", trigger: "blur" },
          {
            pattern: /^[1-9]\d*$/,
            message: "请输入正确的员工人数",
            trigger: "blur",
          },
        ],
        customerDemand: [
          { required: true, message: "客户需求不能为空", trigger: "change" },
          { max: 25, message: "客户需求长度不能超过25个字", trigger: "blur" },
        ],
        quotationDescription: [
          { required: true, message: "报价说明不能为空", trigger: "blur" },
          {
            max: 1000,
            message: "报价说明长度不能超过1000个字",
            trigger: "blur",
          },
        ],
        paymentMethod: [
          { required: true, message: "付款方式不能为空", trigger: "blur" },
          {
            max: 1000,
            message: "付款方式长度不能超过1000个字",
            trigger: "blur",
          },
        ],
        afterService: [
          {
            max: 1000,
            message: "售后服务长度不能超过1000个字",
            trigger: "blur",
          },
        ],
        tips: [
          {
            max: 1000,
            message: "温馨提示长度不能超过1000个字",
            trigger: "blur",
          },
        ],
        approvalName: [
          { required: true, validator: approvalName, trigger: "change" },
        ],
        approvalInformation: [
          {
            max: 1000,
            message: "审批信息长度不能超过1000个字",
            trigger: "blur",
          },
        ],
        approvalResults: [
          { required: true, message: "审批结果不能为空", trigger: "blur" },
        ],
      },
      opt: "add",
      id: "",
      obj: null,
      index: null,
      newIndex: "",
      edit: "edit",
      uuid: "",
      qId: "",
      cId: "",
      customName: "",
      liaison: "",
      telephoneNumber: "",
      customId: "",
      newBusinessId: "",
      isSame: true,
      businessCode: "businessinfo",
      productInfoList: [],
      qualificationList: [],
      productNames: [],
      newBId: "",
      total3: 0,
      quotationInfoList: [],
      adminuser:null
    };
  },
  created() {
    this.listType();
    this.getList();
    this.getProductList();
    this.getDicts();
    this.adminuser=this.$store.state.user.info.userId
    console.log(this.$store.state.user.info.userId,'this.$store.state.user.info')
  },
  methods: {
    //商机提供人
    getlistManager() {
      listManager().then(res => {
        // this.certificateTypeOptions = res.data;
        this.certificateTypeOptions= res.data;
        console.log(res);
      });
    },
    //查询荣誉资质所有类型
    getDicts() {
      getDicts('business_classify').then(res => {
        this.managerList = res.data;
      });
    },
    handleManagerSelect(manager) {
    // 如果点击的是当前选中的manager，则取消选中
    // 否则，更新选中的manager为当前点击的manager
      if (this.queryParams.businessType === manager.dictValue) {
        this.queryParams.businessType = null; // 再次点击取消选择
      } else {
        this.queryParams.businessType = manager.dictValue;
      }
    this.handleQuery()
  },
    async getContactsList(companyId) {
      console.log(companyId);
      const params = {
        enterpriseId: companyId,
        organizationId: this.$store.state.user.info.orgId,
      };
      const response = await listPerson(params);
      if (response && response.rows) {
        this.contactsList = response.rows;
        // 如果有默认联系人和电话，将其设置为第一个选项
        if (this.defaultContact && this.defaultPhone) {
          const defaultPerson = {
            id: "default",
            name: this.defaultContact,
            phone: this.defaultPhone,
          };
          // 检查默认联系人是否已存在于列表中
          const exists = this.contactsList.some(
            contact => contact.phone === this.defaultPhone
          );
          if (!exists) {
            this.contactsList.unshift(defaultPerson);
          }
        }
      }
    },

    handleContactChange(value) {
      const selectedPerson = this.contactsList.find(
        item => item.name === value
      );
      if (selectedPerson) {
        this.form.unit = selectedPerson.phone;
      }
    },

    handleEditQuotation(row) {
      // 重置表单
      this.reset();
      // 设置按钮和表单状态
      this.disabled = false; // 启用表单编辑
      this.isDel = true; // 显示删除按钮
      this.isSave = true; // 显示保存按钮
      this.isPrint = false; // 隐藏打印按钮
      this.isTwoSave = false; // 隐藏复制按钮
      this.isShow = false; // 隐藏审批结果区域
      // 获取报价单详细信息
      const id = row.quotationId;
      getQuotationInfo(id).then(response => {
        this.form = response.data;
        // 设置显示昵称
        this.form.approvalDisplayName =
          response.data.approvalNickName || response.data.approvalName;
        // 获取报价单产品信息列表
        this.queryParamsMessage.quotationId = id;
        listMessage(this.queryParamsMessage).then(response => {
          this.tableData = response.rows;
        });
      });
      // 获取联系人列表
      this.getContactsList(row.companyId);
      // 设置标题和打开弹窗
      this.titleQuotation = "修改报价单信息";
      this.openQuotation = true;
    },

    handleViewQuotation(row) {
      this.result = false;
      this.isPrint = false;
      this.isSave = true;
      const id = row.quotationId;
      getQuotationInfo(id).then(response => {
        this.reset();
        this.form = response.data;
        // 设置显示昵称
        this.form.approvalDisplayName =
          response.data.approvalNickName || response.data.approvalName;
        this.disabled = true;
        this.isDel = false;
        this.isSave = false;
        this.isShow = false;
        this.isTwoSave = false;
        if (this.form.approvalResults === "同意") {
          this.isPrint = true;
        }
        if (
          this.form.approvalResults != null &&
          this.form.approvalResults !== ""
        ) {
          this.result = true;
          this.isShow = true;
          this.isTwoSave = true;
        }
        if (
          this.form.approvalResults === "同意" ||
          this.form.approvalResults === "不同意"
        ) {
          this.isSave = false;
        }
      });
      this.queryParamsMessage.quotationId = row.quotationId;
      listMessage(this.queryParamsMessage).then(response => {
        this.tableData = response.rows;
      });
      this.openQuotation = true;
    },
    handleDeleteQuotation(row) {
      const ids = row.quotationId;
      this.$modal
        .confirm('是否确认删除立项编号为"' + row.approvalNumber + '"的数据项？')
        .then(function () {
          return delInfo(ids);
        })
        .then(() => {
          this.getQuotation();
          this.$modal.msgSuccess("删除成功");
        })
        .catch(() => {});
    },
    getQuotation() {
      this.queryParamsQuotation.businessId = this.newBId;
      listInfo(this.queryParamsQuotation).then(response => {
        this.quotationInfoList = response.rows;
        this.total3 = response.total;
      });
    },
    handleToEnterprise(row) {
      this.$router.push(
        "/enterprise/enterpriseinfo?enterpriseName=" + row.enterpriseName
      );
    },
    //下载
    handleDownload(fileUrl, fileName) {
      let params = {
        resource: fileUrl,
      };
      download("/common/download/resource", params, fileName);
    },
    handleView(row) {
      if (row.url != null && row.url !== "" && row.url.indexOf(".pdf") !== -1) {
        this.handlePictureCardPreviewPdf(row.url);
      } else {
        this.handlePictureCardPreview(row.url);
      }
    },
    queryUploadFile(id) {
      queryFile(id, this.businessCode).then(response => {
        this.fileList = response.data;
        console.log(this.fileList);
      });
      this.openFileList = true;
    },
    carCheck(numbers) {
      this.qualificationList.forEach(item => {
        for (var j = 0; j < numbers.length; j++) {
          if (item.id === numbers[j].productId) {
            this.$refs.tableProduct.toggleRowSelection(item, true);
          }
        }
      });
    },
    handleSelectionChangeContractProduct(selection) {
      if (selection && selection.productName) {
        this.productNames = selection.productName;
      } else {
        this.productNames = null;
      }
    },
    saveContractProduct() {
      if (!this.productNames) {
        this.$modal.msgError("请先选择产品！");
        return;
      }

      // 确保 showIndex 有效且 tableData 存在对应索引的数据
      if (!this.tableData || !this.tableData[this.showIndex - 1]) {
        this.$modal.msgError("产品选择出错，请重试！");
        this.openProduct = false;
        return;
      }

      // 检查产品是否已经存在于表格中
      const isProductExists = this.tableData.some((item, index) => {
        // 跳过当前正在编辑的行
        if (index === this.showIndex - 1) {
          return false;
        }
        return item.systemType === this.productNames.toString();
      });

      if (isProductExists) {
        this.$modal.msgError("该产品已经添加过，请选择其他产品！");
        return;
      }

      try {
        // 确保当前行数据存在
        if (!this.tableData[this.showIndex - 1]) {
          this.tableData[this.showIndex - 1] = {
            indexTwo: this.showIndex,
            id: this.guid(),
            quotationId: this.qId,
            systemType: "",
            fees: "",
            notes: "",
          };
        }

        // 更新产品信息
        this.$set(
          this.tableData[this.showIndex - 1],
          "systemType",
          this.productNames.toString()
        );

        this.openProduct = false;
      } catch (error) {
        console.error("保存产品信息时出错:", error);
        this.$modal.msgError("保存产品信息失败，请重试！");
      }
    },
    selectProduct(index) {
      if (!this.tableData) {
        this.tableData = [];
      }

      this.showIndex = index;
      this.openProduct = true;

      // 重置选择状态
      this.$nextTick(() => {
        if (this.$refs.tableProduct) {
          this.$refs.tableProduct.setCurrentRow(null);
        }
        this.productNames = null;
      });
    },
    getProductList() {
      this.loading = true;
      this.queryContractProductParams.productStatus = "已上架";
      listQualificationAll(this.queryContractProductParams).then(response => {
        this.qualificationList = response.rows;
        this.total2 = response.total;
        this.loading = false;
      });
    },
    resetQueryProduct() {
      this.queryContractProductParams.classificationId = null;
      this.queryContractProductParams.productStatus = null;
      this.resetProduct();
      this.handleQueryProduct();
    },
    handleQueryProduct() {
      this.queryContractProductParams.pageNum = 1;
      this.getProductList();
    },

    twoSave() {
      this.isTwoSave = false;
      this.isSave = true;
      this.isSame = false;
      this.disabled = false;
      this.isDel = true;
      this.isPrint = false;
      this.isShow = false;
      this.qId = this.guid();
      this.form.approvalNumber = null;
      this.form.approvalResults = null;
      this.form.approvalInformation = null;
    },
    handleContract(row) {
      this.dialogVisibleshop=true
      this.shopform.businessStatus==null
      this.shopform.businessId=row.businessId
      // this.customerId = row.enterpriseId;
      // this.contractName = row.businessName;
      // this.uuid = this.guid();
      // this.edit = "addContract";
      // this.cId = this.uuid;
      // this.isClick = true;
      // this.type = 3;
    },
    // 提交上传文件
    submitFileForm() {
      this.$refs.upload.submit();
    },
    // 表单重置
    resetProduct() {
      this.queryContractForm = {
        id: null,
        productType: null,
        productNo: null,
        productName: null,
        productPrice: null,
        productSellPrice: null,
        productStatus: null,
        enterpriseId: null,
        enterpriseName: null,
        productRemark: null,
        exeStandard: null,
        template: null,
        operateId: null,
        departmentId: null,
        organizationId: null,
        departmentName: null,
        organizationName: null,
        creationTime: null,
        operateTime: null,
        createId: null,
        selectUrl: null,
        userName: null,
        releaseTime: null,
        approve: null,
        classificationId: null,
        uploadFile: null,
      };
      this.resetForm("queryContractForm");
    },
    addProductInfo() {
      const tableList = this.tableData;

      // 检查是否有未完成的行
      const hasIncompleteRow = tableList.some(
        row =>
          !row.systemType?.trim() ||
          !row.fees?.toString().trim() ||
          !row.notes?.trim()
      );

      if (hasIncompleteRow) {
        this.$message.error("请先完善当前行数据！");
        return;
      }

      // 添加新行
      this.tableData.push({
        indexTwo: tableList.length + 1,
        id: this.guid(),
        quotationId: this.qId,
        systemType: "",
        fees: "",
        notes: "",
      });
    },
    // 文件上传中处理
    handleFileUploadProgress(event, file, fileList) {
      this.upload.isUploading = true;
    },
    // 文件上传成功处理
    handleFileSuccess(response, file, fileList) {
      this.upload.open = false;
      this.upload.isUploading = false;
      this.$refs.upload.clearFiles();
      this.$alert(
        "<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
          response.msg +
          "</div>",
        "导入结果",
        { dangerouslyUseHTMLString: true }
      );
      this.getList();
    },
    handleCurrentChange(row, column, event) {
      this.obj = row;
      this.newIndex = row.index;
      this.bId = row.businessId;
      this.openRecords = true;
    },
    delProductInfo(row) {
      this.tableData = this.tableData.filter(data => data.id !== row.id);
      if (row.number !== "" && row.number != null) {
        this.sum =
          parseInt(this.sum) + parseInt(this.tempSum) - parseInt(row.number);
      }
    },
    close() {
      this.$emit("change");
      this.type = 2;
      this.getList();
    },
    loadList() {
      this.getList();
    },
    /** 下载模板操作 */
    importTemplate() {
      this.download(
        "/business/information/importTemplate",
        {},
        `商机管理数据.xlsx`
      );
    },
    //树点击事件
    getNode(data, node, obj) {
      this.openRecords = false;
      this.queryParams.classificationId = data.id;
      this.classId = data.id;
      this.getList();
    },
    /** 查询【请填写功能名称】列表 */
    getList() {
      this.loading = true;
      if (this.enterpriseId != null && this.enterpriseId !== "") {
        this.queryParams.enterpriseId = this.enterpriseId;
      }
      listInformation(this.addDateRange(this.queryParams, this.dateRange)).then(
        response => {
          this.informationList = response.rows;
          this.total = response.total;
          this.loading = false;
        }
      );
    },
    listType() {
      listType({ typeCode: "business" }).then(res => {
        this.optionData = res.data;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.dialogVisibleshop=false
      this.reset();
    },
    closePrint() {
      this.openPrint = false;
    },
    cancelClass() {
      this.openMainClass = false;
      this.resetClass();
    },
    // 表单重置
    resetClass() {
      this.formClass = {
        classificationId: null,
      };
    },
    reset() {
      this.form = {
        quotationId: null,
        businessId: null,
        approvalNumber: null,
        companyId: null,
        companyName: null,
        employeeNumber: null,
        address: null,
        certificateAuthority: null,
        contacts: null,
        customerDemand: null,
        unit: null,
        quotationDescription: null,
        paymentMethod: null,
        afterService: null,
        tips: null,
        isSubmit: null,
        approvalId: null,
        approvalName: null,
        approvalResults: null,
        approvalInformation: null,
        creationTime: null,
        operateTime: null,
        operateId: null,
      };
      this.resetForm("form");
      this.tableData = [];
      this.contactsList = [];
      this.defaultContact = null;
      this.defaultPhone = null;
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.openRecords = false;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.dateRange = [];
      this.queryParams.classificationId = null;
      this.queryParams.businessState=null;
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.businessId);
      this.single = selection.length !== 1;
      this.multiple = !selection.length;
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.openRecords = false;
      if (this.enterpriseId != null && this.enterpriseId !== "") {
        this.eId = this.enterpriseId;
        this.eName = this.enterpriseName;
      }
      this.uuid = this.guid();
      this.edit = "add";
      this.isClick = true;
      this.type = 1;
    },
    /** 修改按钮操作 */
    handleUpdate(row, index) {
      this.newBId = row.businessId;
      this.rowList=row
      this.openRecords = false;
      this.index =
        (this.queryParams.pageNum - 1) * this.queryParams.pageSize + index;
      this.edit = "edit";
      this.isClick = false;
      if (this.enterpriseId != null && this.enterpriseId !== "") {
        this.eId = this.enterpriseId;
        this.eName = this.enterpriseName;
      }else {
        this.eId=row.enterpriseId;
        this.eName=row.enterpriseName;
      }
      this.id = row.businessId;
      this.businessName = row.businessName;
      this.type = 1;
    },
    handlePictureCardPreview(url) {
      this.dialogImageUrl = url;
      this.dialogVisible = true;
    },
    handlePictureCardPreviewPdf(url) {
      this.pdfUrl = pdf.createLoadingTask(url);
      // 获取页码
      this.pdfUrl.promise
        .then(pdf => (this.pageTotal = pdf.numPages))
        .catch(error => {});
      this.dialogImageUrlPdf = url;
      this.dialogVisiblePdf = true;
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const businessIds = row.businessId || this.ids;
      this.$modal
        .confirm('删除商机会删除与之关联的报价单和合同，是否确认删除？')
        .then(function () {
          return delInformation(businessIds);
        })
        .then(() => {
          this.getList();
          this.$modal.msgSuccess("删除成功");
        })
        .catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download(
        "business/information/export",
        {
          ...this.queryParams,
        },
        `商机管理信息数据_${new Date().getTime()}.xlsx`
      );
    },
    handleImport() {
      this.upload.title = "用户导入";
      this.upload.open = true;
    },
    editMainClass() {
      this.listType();
      if (this.ids.length === 0) {
        this.$message.error("请选择要修改的商机信息！");
      } else {
        this.openMainClass = true;
      }
    },
    indexMethod(index) {
      return (
        (this.queryParams.pageNum - 1) * this.queryParams.pageSize + index + 1
      );
    },

    indexProductMethod(index) {
      return (
        (this.queryContractProductParams.pageNum - 1) *
          this.queryContractProductParams.pageSize +
        index +
        1
      );
    },
    //索引初始化到对象
    tableRowClassName({ row, rowIndex }) {
      //把每一行的索引放进row
      row.index =
        (this.queryParams.pageNum - 1) * this.queryParams.pageSize +
        rowIndex +
        1;
    },
    guid() {
      function S4() {
        return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
      }
      return (
        S4() +
        S4() +
        "-" +
        S4() +
        "-" +
        S4() +
        "-" +
        S4() +
        "-" +
        S4() +
        S4() +
        S4()
      );
    },
    submitClassForm() {
      if (
        this.formClass.classificationId === "undefined" ||
        this.formClass.classificationId === "" ||
        this.formClass.classificationId == null
      ) {
        this.$message.error("请选择主分类！");
      } else {
        const params = {
          businessId: this.ids.toString(),
          mainClassId: this.formClass.classificationId,
        };
        editMainClass(params).then(response => {
          this.$modal.msgSuccess("修改成功");
          this.openMainClass = false;
          this.getList();
        });
      }
    },
    selectUser(userId, userName, phone, position,nickName) {
      console.log("show", this.show)
      if (this.show == "1") {
        console.log("是否是修改商机信息")
        const params = {
          businessId: this.ids.toString(),
          transactionId: userId,
          businessManager: nickName,
        };
        editBusinessManager(params).then(response => {
          this.$modal.msgSuccess("修改成功");
          this.getList();
        });
      } else if (this.show == "2") {
        this.$set(this.form, "approvalName", userName);
        this.$set(this.form, "approvalId", userId);
      }
    },
    selectRoleUser(userId, userName, phone, position, nickName) {
      // 使用普通对象先准备所有更新
      const updates = {
        approvalName: userName,
        approvalId: userId,
        approvalDisplayName: nickName || userName,
        approvalNickName: nickName,
      };

      // 一次性更新所有属性
      Object.keys(updates).forEach(key => {
        this.$set(this.form, key, updates[key]);
      });

      // 强制更新视图
      this.$forceUpdate();
    },
    userShow(type) {
      this.show = type;
      if (type === "1") {
        if (this.ids.length === 0) {
          this.$message.error("请选择要修改的商机信息！");
        } else {
          this.$refs.select.show();
        }
      } else {
        this.$refs.select.show();
      }
    },
    userRoleShow() {
      this.$refs.selectRole.show();
    },
    handleAddQuotation() {
      this.reset();
      this.disabled = false;
      this.isDel = true;
      this.isSave = true;
      this.isPrint = false;
      this.isTwoSave = false;
      this.form.businessId = this.rowList.businessId;
      this.newBusinessId = this.rowList.businessId;
      this.form.companyName = this.rowList.enterpriseName;
      this.form.companyId = this.rowList.enterpriseId;
      this.form.contacts = this.rowList.contacts;
      this.form.unit = this.rowList.telephone;
      this.customName = this.rowList.enterpriseName;
      this.customId = this.rowList.enterpriseId;
      this.liaison = this.rowList.contacts;
      this.telephoneNumber = this.rowList.telephone;
      getInfo(this.customId).then(response => {
        if (
          response.data.enterpriseName == null ||
          response.data.enterpriseName === ""
        ) {
          getSeas(this.customId).then(response => {
            if (response.data === undefined) {
              getElectric(this.customId).then(response => {
                if (response.data === undefined) {
                  getSupplierInfo(this.customId).then(response => {
                    this.form.address = response.data.enterpriseAddress;
                  });
                } else {
                  this.form.address = response.data.enterpriseAddress;
                }
              });
            } else {
              this.form.address = response.data.enterpriseAddress;
            }
          });
        } else {
          this.form.address = response.data.enterpriseAddress;
        }
      });
      // 保存默认联系人和电话
      this.defaultContact = this.rowList.contacts;
      this.defaultPhone = this.rowList.telephone;
      // 获取联系人列表
      this.getContactsList(this.rowList.enterpriseId);
      // 设置默认联系人和电话
      this.form.contacts = this.rowList.contacts;
      this.form.unit = this.rowList.telephone;
      this.tableData = [];
      this.isShow = false;
      this.qId = this.guid();
      this.titleQuotation = "新增报价单信息";
      this.openQuotation = true;
      this.queryParamsQuotation.businessId = this.rowList.businessId;
    },
    addQuotation(row) {
      this.rowList = row;
      console.log(this.rowList,'11');
      this.newBId = row.businessId;
      this.getQuotation();
      setTimeout(() => {
        this.openQuotationList = true;
      }, 300);
    },
    cancelQuotation() {
      this.openQuotation = false;
      this.tableData = [];
      this.reset();
    },
    //打印预览
    printPreview() {
      const id = this.form.quotationId;
      getQuotationInfo(id).then(response => {
        this.form = response.data;
        this.newApprovalNumber = this.form.approvalNumber;
        this.newCompanyName = this.form.companyName;
        this.newEmployeeNumber = this.form.employeeNumber;
        this.newAddress = this.form.address;
        this.newCertificateAuthority = this.form.certificateAuthority;
        this.newContacts = this.form.contacts;
        this.newPhone = this.form.unit;
        this.newCustomerDemand = this.form.customerDemand;
        this.newUnit = this.form.unit;
        this.newQuotationDescription = this.form.quotationDescription;
        this.newPaymentMethod = this.form.paymentMethod;
        this.newAfterService = this.form.afterService;
        this.newTips = this.form.tips;
      });
      this.queryParamsMessage.quotationId = id;
      listMessage(this.queryParamsMessage).then(response => {
        this.tableData = response.rows;
      });
      sysDeptInfo().then(response => {
        this.newEnterpriseAddress = response[0].address;
        this.newEnterpriseName = response[0].deptName;
        this.newTelephone = response[0].phone;
      });
      this.openPrint = true;
    },
    //打印
    printInformation() {
      this.$print(this.$refs.print, "no - print");
      // window.print(); // 调用浏览器的打印功能
    },
    /** 保存按钮 */
    saveFormQuotation() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          var tableList = this.tableData;
          // 先检查所有产品信息是否完整
          for (var i = 0; i < tableList.length; i++) {
            if (
              !tableList[i].systemType ||
              !tableList[i].fees ||
              !tableList[i].notes
            ) {
              this.$message.error("请完善报价单产品信息！");
              return; // 直接返回整个方法
            }
          }
          // 所有产品信息完整后，再进行保存操作
          if (this.form.quotationId != null && this.isSame) {
            this.form.isSubmit = "0"; // 设置保存状态
            this.form["productMessageList"] = this.tableData;
            const data = this.form;
            updateQuotationProductMessage(data).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.openQuotation = false;
              this.tableData = [];
              this.getList();
              this.getQuotation();
            });
          } else {
            this.form.quotationId = this.qId;
            this.form.isSubmit = "0"; // 设置保存状态
            this.form["productMessageList"] = this.tableData;
            const data = this.form;
            saveQuotationProductMessage(data).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.openQuotation = false;
              this.tableData = [];
              this.getList();
              this.getQuotation();
            });
          }
        }
      });
    },
    submitForm() {
      console.log(this.shopform.businessStatus,'this.shopform.businessStatus')
      if(this.shopform.businessStatus==null){
        this.$message.error('请选择审核意见')
      }else{
        updateInformation(this.shopform).then(res => {
            this.$message.success('审核成功')
            this.dialogVisibleshop=false
            this.shopform.businessStatus==null
            this.getList()
          })
      }
      // this.$refs["shopform"].validate(valid => {
        // if (valid) {

        // }
      // })
      },
    submitFormQuotation() {
      this.$refs["form"].validate(valid => {
        if (!valid) {
          return;
        }
        // 检查是否有产品信息
        if (!this.tableData || this.tableData.length === 0) {
          this.$message.error("请至少添加一条产品信息！");
          return;
        }
        // 检查所有产品信息是否完整
        const hasIncompleteProduct = this.tableData.some(
          item =>
            !item.systemType?.trim() ||
            !item.fees?.toString().trim() ||
            !item.notes?.trim()
        );
        if (hasIncompleteProduct) {
          this.$message.error("请完善所有报价单产品信息！");
          return;
        }
        // 确认提交
        this.$confirm("提交后不能再修改报价单信息，是否继续？", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        })
          .then(() => {
            // 准备提交数据
            const submitData = {
              ...this.form,
              isSubmit: "1", // 设置提交状态
              productMessageList: this.tableData,
            };

            // 如果是新增，添加quotationId
            if (!this.form.quotationId || !this.isSame) {
              submitData.quotationId = this.qId;
            }

            // 根据是否存在quotationId决定是新增还是修改
            const request =
              this.form.quotationId && this.isSame
                ? updateQuotationProductMessage(submitData)
                : saveQuotationProductMessage(submitData);

            // 发送请求并处理响应
            request
              .then(response => {
                this.$modal.msgSuccess(
                  this.form.quotationId && this.isSame ? "修改成功" : "新增成功"
                );
                this.handleSubmitSuccess();
              })
              .catch(error => {
                this.$modal.msgError(
                  "操作失败：" + (error.message || "未知错误")
                );
              });
          })
          .catch(() => {
            this.$message({
              type: "info",
              message: "已取消提交",
            });
          });
      });
    },
    // 提取成功处理逻辑为独立方法
    handleSubmitSuccess() {
      this.openQuotation = false;
      this.tableData = [];
      this.getList();
      this.getQuotation();
    },
  },
};
</script>
<style lang="scss">
/* CSS Document */
div,
ul,
li,
p,
h1,
h2,
h3,
h4 {
  padding: 0;
  margin: 0;
}

li {
  list-style: none;
}

a {
  text-decoration: none;
}

img {
  border: none;
}

.baojia-fram {
  width: 93%;
  background-color: #fff;
  position: relative;
  margin: 0 auto;
}

.baojia-fram .eetwo {
  text-indent: 30px;
}

.baojia-header {
  position: relative;
  display: inline-block;
  width: 100%;
}

.baojia-header h2 {
  width: 100%;
  float: left;
  border-bottom: 1px solid #ccc;
  font-size: 14px;
  color: #000;
  height: 34px;
  line-height: 34px;
  padding: 4px 0;
}

.baojia-header h2 lable {
  float: left;
  padding-left: 20px;
}

.baojia-header h2 span {
  float: right;
  padding-right: 20px;
}

.baojia-header h2 lable img {
  width: 34px;
  height: 34px;
  display: inline-block;
  vertical-align: middle;
}

.baojia-infor {
  position: relative;
  width: 98%;
  margin: 0 auto;
  padding: 10px;
}

.baojia-infor-title {
  text-align: center;
  font-size: 20px;
  color: black;
  font-weight: normal;
}

.baojia-infor-title b {
  font-size: 24px;
}

.baojia-infor-title label {
  font-size: 16px;
  color: #333;
}

.baojia-infor .baojia-infor-p p {
  font-size: 14px;
  color: #000;
  line-height: 18px;
  padding: 4px 0;
}

.baojia-infor .baojia-table {
  width: 100%;
  border: 1px solid #ddd;
  border-spacing: 0px;
  border-collapse: collapse;
  color: black;
}

.baojia-infor .baojia-table th,
.baojia-infor .baojia-table td {
  border: 1px solid #ddd;
  padding: 4px 0;
  text-align: center;
}

.baojia-infor .baojia-table th {
  background: #f7f7f7;
  line-height: 24px;
}

.baojia-infor .baojia-table td p {
  padding: 0;
}

.baojia-infor .line {
  border-bottom: 1px dashed #ccc;
  width: 100%;
  height: 10px;
}

.baojia-div {
  width: 100%;
  padding-top: 20px;
  font-size: 14px;
  color: black;
}

.baojia-div-left,
.baojia-div-right {
  width: 48%;
  display: inline-block;
  vertical-align: top;
}

.baojia-div-left li,
.baojia-div-right li {
  display: block;
  padding: 5px 0;
  line-height: 35px;
}

.baojia-div-left li span {
  width: 50%;
  display: inline-block;
  border-bottom: 1px solid #ddd;
}

.baojia-infor-btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 20px 0 5px 0;
}

.baojia-infor-btn button {
  padding: 0 20px;
  height: 35px;
  background: #108cc2;
  border: none;
  color: white;
  border-radius: 4px;
  margin: 0 10px;
  cursor: pointer;
}

.baojia-infor-btn button:hover {
  background: #097daf;
}

.el-transfer-panel {
  width: 300px;
  padding-bottom: 50px;
}

.el-form-item--small.el-form-item {
  margin-bottom: 12px;
}

.el-descriptions-item__label:not(.is-bordered-label) {
  font-size: 12px;
}

.el-table .el-textarea__inner {
  min-height: 32px !important;
  height: 32px !important;
  line-height: 20px !important;
  padding: 5px 8px !important;
}

.el-table .el-input.el-input--small .el-input__inner {
  height: 32px !important;
  line-height: 32px !important;
}
.manager-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;

  .manager-tag {
    padding: 4px 12px;
    border: 1px solid #DCDFE6;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;

    &:hover {
      border-color: #409EFF;
      color: #409EFF;
    }

    &.active {
      background-color: #409EFF;
      border-color: #409EFF;
      color: #fff;
    }
  }
}
.label-nowrap .el-form-item__label {
  white-space: nowrap; /* 确保文本不会换行 */
}
//.teacher-form-container {
//  overflow-y: auto;
//  overflow-x: auto;
//  padding: 16px;
//  max-width: 100%;
//  max-height: 90vh;
//  box-sizing: border-box;
//}
</style>
